#include<iostream>
#include<Eigen/Dense>

using namespace std;
using namespace Eigen;

int main(int argc,char** argv){

    Matrix4f m;
    for(int i =0;i<4;++i){
        for(int j=0;j<4;++j){
            m(i,j) = j + 1 + i * 4;
        }
    }

    cout << "m: \n" << m << endl;
    cout << "Block in the middle" << endl;
    cout << m.block<2,2>(1,1) <<"\n\n";
    for(int i=1;i<=3;++i){
        cout << "Block of size " << i << "x" << i << endl;
        cout << m.block(0,0,i,i) << "\n\n";
    }

    return 0;
}
